core: Print which xattrs are not sorted
authorColin Walters <walters@verbum.org>
Tue, 25 Feb 2025 18:19:27 +0000 (13:19 -0500)
committerColin Walters <walters@verbum.org>
Tue, 25 Feb 2025 19:58:35 +0000 (14:58 -0500)
I hit this in the rpm-ostree rechunker flow somehow
and with this change I now get:

`error: Generating commit from rootfs: Processing dir var: Writing content object: Incorrectly sorted xattr name (prev=user.Librepo.checksum.mtime, cur=security.selinux), index=2`

which is more useful, although I still need to figure out
and fix why that's happening (again?).

Signed-off-by: Colin Walters <walters@verbum.org>
src/libostree/ostree-core.c

index e67c23f81b17de057b255fac47e97e6e9150c46a..4a9d68daa5670806458e51fcf09aab1567fa0022 100644 (file)
@@ -2342,7 +2342,8 @@ _ostree_validate_structureof_xattrs (GVariant *xattrs, GError **error)
           if (cmp == 0)
             return glnx_throw (error, "Duplicate xattr name, index=%d", i);
           else if (cmp > 0)
-            return glnx_throw (error, "Incorrectly sorted xattr name, index=%d", i);
+            return glnx_throw (error, "Incorrectly sorted xattr name (prev=%s, cur=%s), index=%d",
+                               previous, name, i);
         }
       previous = name;
       i++;